package com.mvvm.store.ui;

import android.content.Intent;
import android.view.KeyEvent;
import android.view.View;
import com.mvvm.store.R;
import com.mvvm.store.base.BaseActivity;
import com.mvvm.store.base.NormalViewModel;
import com.mvvm.store.databinding.ActivityMainBinding;
import com.mvvm.store.databinding.ActivityMainRestBinding;
import com.mvvm.store.ui.delivery.DeliveryManagerActivity;
import com.mvvm.store.ui.delivery.OutboundManagerActivity;
import com.mvvm.store.ui.into.IntoStorageActivity;
import com.mvvm.store.ui.into.ScanIntoActivity;
import com.mvvm.store.ui.stockup.StockUpManagerActivity;


/**
 * Created by leo
 * on 2020/10/21.
 */
public class MainActivity extends BaseActivity<NormalViewModel, ActivityMainRestBinding> {

    @Override
    protected int getContentViewId() {
        return R.layout.activity_main_rest;
    }

    @Override
    protected void processLogic() {

    }

    @Override
    protected void setListener() {
        binding.setOnClickListener(this::onClick);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.ll_into_manager: //入库管理
                Intent intent=new Intent(MainActivity.this, ScanIntoActivity.class);
                startActivity(intent);
                break;
            case R.id.ll_out_manager://出库管理
                Intent intentDelivery=new Intent(MainActivity.this, OutboundManagerActivity.class);
                startActivity(intentDelivery);

                break;
            case R.id.ll_choice_manager://备货管理
                Intent intentStock=new Intent(MainActivity.this, StockUpManagerActivity.class);
                startActivity(intentStock);
                break;

            default:

                break;
        }
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if(keyCode == KeyEvent.KEYCODE_BACK){
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }
}
